Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-10907. DataNode StorageContainerMetrics numWriteChunk is counted multiple times #6835

Merged
merged 7 commits into from
Jul 16, 2024

Conversation

chungen0126
Copy link
Contributor

What changes were proposed in this pull request?

StorageContainerMetrics.incContainerOpsMetrics() updates operation counts. It is incremented not just once for WriteChunk, because it is called by HddsDispatcher.dispatchRequest() during WRITE_DATA (by ContainerStateMachine.writeStateMachineData()) and COMMIT_DATA phase.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-10907

How was this patch tested?

Add assertion of containerMetrics in TestBlockOutputStream

@chungen0126 chungen0126 deleted the HDDS-10907 branch June 20, 2024 10:01
@chungen0126 chungen0126 restored the HDDS-10907 branch June 20, 2024 10:02
@chungen0126 chungen0126 reopened this Jun 20, 2024
@chungen0126
Copy link
Contributor Author

It seem that adding the test in TestContainerMetrics is better. I'll update it later.

ContainerTestHelper.getWriteChunkRequest(
pipeline, blockID, 1024);
ContainerCommandResponseProto response =
client.sendCommand(writeChunkRequest);
ContainerCommandResponseProto response = client.sendCommand(writeChunkRequest);
assertEquals(ContainerProtos.Result.SUCCESS,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should check the related metrics in containerMetrics are correct. In specific, make sure numWriteChunk is expected.

Copy link
Contributor Author

@chungen0126 chungen0126 Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some assertions for containerMetrics:

assertCounter("NumOps", 3L, containerMetrics);
assertCounter("numCreateContainer", 1L, containerMetrics);
assertCounter("numWriteChunk", 1L, containerMetrics);
assertCounter("numReadChunk", 1L, containerMetrics);

Is it enough?

Copy link
Contributor

@jojochuang jojochuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 merging it

@adoroszlai
Copy link
Contributor

@jojochuang CI passed, in case you want to merge

@jojochuang jojochuang merged commit 63a232b into apache:master Jul 16, 2024
39 checks passed
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 26, 2024
… multiple times (apache#6835)

Co-authored-by: Doroszlai, Attila <adoroszlai@apache.org>

(cherry picked from commit 63a232b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants